<div class="span9">
  <div class="thumbnail">
    <!-- breadcrumb -->
    <ul class="breadcrumb">
      <li><a href="{:U(GROUP_NAME . '/Index/index')}">用户管理</a> <span class="divider">/</span></li>
      <li class="active">添加用户</li>
    </ul>

    <h3 class="text-center">添加用户</h3>
    <form class="form-horizontal" role="form" method="post" action="{:U(GROUP_NAME . '/Index/addUserHandle')}">
      <!-- 用户名称 -->
      <div class="control-group">
        <label class="control-label">用户名</label>
        <div class="controls">
          <input type="text" name="username" placeholder="用户名">
        </div>
      </div>
      <!-- 密码 -->
      <div class="control-group">
        <label class="control-label">用户密码</label>
        <div class="controls">
          <input type="hidden" name="password" value="123456">
          <input type="text" value="初始密码为 123456" readonly>
        </div>
      </div>
      <!-- 邮箱 -->
      <div class="control-group">
        <label for="email" class="control-label">邮箱</label>
        <div class="controls">
          <input type="email" name="email" id="email" placeholder="邮箱">
        </div>
      </div>
      <!-- QQ -->
      <!-- <div class="control-group">
        <label for="qq" class="control-label">QQ</label>
        <div class="controls">
          <input type="text" name="qq" id="qq" placeholder="QQ">
        </div>
      </div> -->
      <!-- 是否开启 -->
      <div class="control-group">
        <label for="title" class="control-label">状态</label>
        <div class="controls">
          <select name="status" id="">
            <option value="0">关闭</option>
            <option value="1">开启</option>
          </select>
        </div>
      </div>
      <!-- 所属角色 -->
      <div class="control-group" id="add-role-group">
        <label for="title" class="control-label">所属角色</label>
        <!-- <input type="button" class="btn control-label" id="add-role" value="添加一个角色"> -->
        <div class="controls">
          <select id="select" name="role_id[]">
            <volist name="role" id="r">
              <option value="{$r.id}">{$r.name}({$r.remark})</option>
            </volist>
          </select>
          <input type="button" class="btn" id="add-role" value="添加一个角色">
        </div>
      </div>

      <div class="control-group" id="last">
        <br>
        <div class="controls">
          <!-- <a href="{:U(GROUP_NAME . '/Index/addUser')}">取消添加</a> -->
          <button type="submit" class="btn btn-primary">保存添加</button>
        </div>
      </div>
    </form>
  </div>
</div>

<script>
  $(function () {
    $('#add-role').click(function () {
      var obj = $('#add-role-group').clone();
      obj.find('#add-role').remove();
      $('#last').before(obj);
    });
  });
</script>